<?php

namespace Home\Model\Ajax;

class BbsFollow extends AbstractAjax
{
    // 问题加关注
    public function handle()
    {
        $bid = I('request.bid', '', 'intval');
        if (empty($this->uid)) {
            $ajax['status'] = 0;
            $ajax['content'] = "请登录后操作！";
            return $ajax;
        }

        if (empty($bid)) {
            $ajax['status'] = 0;
            $ajax['content'] = "数据错误！";
            return $ajax;
        }
        $ret = D('Bbs')->follow($bid, $this->uid);
        $ajax['status'] = 1;
        $ajax['content'] = $ret['msg'];
        $ajax['count'] = $ret['count'];
        return $ajax;
    }
}